Repository navigation
fix(#301): 身份改用请求头注入,修复流程列表 500 - #88
Merged
Merged
Conversation
身份原先前端以 query 参数 operatorIdentity 注入所有 /api/ 请求,后端的 SearchRequest 列表接口会把 query 参数当作实体过滤字段解析,导致 Field operatorIdentity not found in class hierarchy,流程列表直接 500。 - flow-core 新增 HttpClient.defaultHeaders 与 mergeDefaultHeaders (undefined 跳过、空串保留以表达「显式默认身份」) - app-pc / app-mobile 身份改为 X-Operator-Identity 请求头,不再写入 query - 补充 mergeDefaultHeaders 单测 Refs codingapi/flow-engine#301
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 issue
codingapi/flow-engine#301
问题
app-pc/app-mobile把当前身份作为 query 参数operatorIdentity注入所有/api/请求(issue #288 引入)。后端的流程列表接口用SearchRequest接收请求,会把 query 参数当作实体过滤字段解析,多一个operatorIdentity就报:流程列表页 500。
修复
flow-core新增HttpClient.defaultHeaders与mergeDefaultHeaders:undefined/null的键跳过(本次不携带);Authorization等已有请求头合并;apps/app-pc、apps/app-mobile改为X-Operator-Identity请求头注入,不再写入 query;mergeDefaultHeaders单测(6 例)。验证
rstest:flow-core 20 用例全绿(http 相关 12 例,含新增 6 例);rslib build(含 d.ts)通过:flow-core / flow-types / flow-icons / flow-approval-presenter / flow-pc-ui / flow-pc-form / flow-pc-approval / flow-design;success:true。依赖
需先合并 codingapi/flow-engine#302(服务端支持请求头读取)。服务端保留了 query 兼容,因此本 PR 单独合并也不会导致旧逻辑失效。